// -----------------------------------------------------------------------------
// Generate By Furion Tools v1.6.0                            
// -----------------------------------------------------------------------------

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;

#nullable disable

namespace iemtm.WeChat.Core
{
    public partial class AnnounceGen : IEntity<MasterDbContextLocator>, IEntityTypeBuilder<AnnounceGen, MasterDbContextLocator>
    {

        public int AnnounceId { get; set; }
        public int GenRecordId { get; set; }
        public string AnnounceCode { get; set; }
        public bool? IsManual { get; set; }
        public bool? IsAuto { get; set; }
        public string BingCode { get; set; }
        public string BingName { get; set; }
        public DateTime? BingTime { get; set; }
    
        public void Configure(EntityTypeBuilder<AnnounceGen> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
                entityBuilder.HasKey(e => new { e.AnnounceId, e.GenRecordId })
                    .HasName("PK__Announce__09A5E4EA66E7D94C");

                entityBuilder.HasIndex(e => e.AnnounceCode, "AnnounceCode");

                entityBuilder.HasIndex(e => e.GenRecordId, "Only)GenRecordId")
                    .IsUnique();

                entityBuilder.Property(e => e.AnnounceCode).HasMaxLength(50);

                entityBuilder.Property(e => e.BingCode).HasMaxLength(100);

                entityBuilder.Property(e => e.BingName).HasMaxLength(100);

                entityBuilder.Property(e => e.BingTime).HasColumnType("datetime");

                entityBuilder.Property(e => e.IsAuto)
                    .IsRequired()
                    .HasDefaultValueSql("((1))");
        }

    }
}

